package com.reggie.controller;

import com.reggie.common.result.PageResult;
import com.reggie.common.result.Result;
import com.reggie.pojo.dto.SjPageQueryDTO;
import com.reggie.service.SjService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
@Slf4j
@Api(tags = "博客列表")
public class SjController {

    @Autowired
    private SjService sjService;

    @GetMapping("/page")
    @ApiOperation("分页查询")
    @CrossOrigin
    public Result<PageResult> page(SjPageQueryDTO sjPageQueryDTO){
        PageResult pageResult=  sjService.page(sjPageQueryDTO);
        return Result.success(pageResult);
    }

}
